package chapter18ShareLock;

/**
 * Created by LinGer on 2019/6/25
 */
public class MyCount {

    /**
     * 账号
     */
    private String id;
    /**
     * 余额
     */
    private int cash;

    public MyCount(String id, int cash) {
        this.id = id;
        this.cash = cash;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public int getCash() {
        System.out.println(Thread.currentThread().getName() + " getCash cash: " + cash);
        return cash;
    }

    public void setCash(int cash) {
        System.out.println(Thread.currentThread().getName() + " setCash cash: " + cash);
        this.cash = cash;
    }
}
